home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 62 / Quick PC 62.iso / Programs / Ipswitch.IMail.Server.Pro.8.0.Winall / IMail8ec.exe / data1.cab / Web_Standard / quickclick.cgi < prev    next >
Encoding:
Text File  |  2003-05-07  |  4.8 KB  |  173 lines

  1.   <!-- Hide from other browsers
  2.  
  3.   //function handleError (err, url, line)
  4.   //{
  5.     //if (err.indexOf('is not defined') != -1)
  6.     //{
  7.       //alert('Oops, something is not defined.\n' +
  8.              //err + '\n' + url + '\nline no: ' + line);
  9.       //return true; // error is handled 
  10.     //}
  11.     //else
  12.     //{
  13.       //return false; // let the browser handle the error
  14.     //}
  15.   //}
  16.   //window.onerror = handleError;
  17.  
  18.     function displayCSS(mouseOn)
  19.   {
  20.       var dropdown, visible, hidden;
  21.       var book = "<!--IMAIL.GetAddresses-->";
  22.     
  23.       if((is_nav4up || is_ie4up) && (book.search('@') != -1))
  24.       {
  25.       if (document.layers)
  26.         {
  27.           visible = 'show';
  28.         hidden = 'hide';
  29.         dropdown = document.layers[CSSObject];
  30.         }
  31.         else if (document.all)
  32.         {
  33.         visible = 'visible';
  34.         hidden = 'hidden';
  35.         dropdown = document.all(CSSObject).style;
  36.         }
  37.       else if (document.getElementById)
  38.       {
  39.         visible = 'visible';
  40.         hidden = 'hidden';
  41.         dropdown = document.getElementById(CSSObject).style;
  42.       }
  43.       
  44.         if(mouseOn == 1)
  45.         {
  46.         dropdown.visibility = visible;
  47.         }
  48.         if(mouseOn == 0 && CSSstatus=="1")
  49.         {
  50.         dropdown.visibility = visible;
  51.         }
  52.         if(mouseOn == 0 && CSSstatus=="0")
  53.         {
  54.         dropdown.visibility = hidden;
  55.         }
  56.     }
  57.   }
  58.  
  59.     function printCSS(choice, codeNum)
  60.   {
  61.       var zero = "0";
  62.       var one  = "1";
  63.       var book2 = "<!--IMAIL.GetAddresses-->";
  64.   
  65.     if(is_ie4up && choice == "menu" && codeNum=="2")
  66.       {
  67.         document.writeln('<TR><TD></TD><TD COLSPAN="5"><DIV ID=' + CSSObject +'><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR>');
  68.         document.write('<FORM name="CSSForm"><TD><SELECT NAME="menuChoices" SIZE="1" VALIGN="top" onChange="return getAddress();"');
  69.         document.write('onFocus="CSSstatus=' + one + '; return true;" onBlur="CSSstatus=' + zero + '; setTimeout(');
  70.       document.write("'displayCSS(0)',500);");
  71.       document.write('">');
  72.         document.writeln('<OPTION VALUE="#">'+ CSSselect + '</OPTION>');
  73.         document.write(book2);
  74.         document.writeln('</SELECT></TD></FORM></TR></TABLE></DIV></TD></TR>');
  75.       }
  76.       if(is_nav4up && choice == "menu" && codeNum=="1")
  77.       {  
  78.         document.writeln('<DIV ID=' + CSSObject +'><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR>');
  79.         document.write('<FORM ID="myAddrForm" name="CSSForm"><TD><SELECT NAME="menuChoices" SIZE="1" VALIGN="top" onChange="return getAddress();"');
  80.         document.write('onFocus="CSSstatus=' + one + '; return true;" onBlur="CSSstatus=' + zero + '; setTimeout(');
  81.       document.write("'displayCSS(0)',500);");
  82.       document.write('">');
  83.         document.writeln('<OPTION VALUE="#">'+ CSSselect + '</OPTION>');
  84.         document.write(book2);
  85.         document.writeln('</SELECT></TD></FORM></TR></TABLE></DIV>');
  86.       }
  87.       
  88.   }
  89.  
  90.   function getAddress()
  91.   {
  92.       var address;
  93.     var i;
  94.     var ip   = "";
  95.     var j    = 0;
  96.     var user = "";
  97.     var name;
  98.     var email;
  99.     var range = CSSObject        // Defined for Navigator 4.X
  100.     var styleObj = ".document.CSSForm"  // Defined for Navigator 4.X
  101.  
  102.  
  103.       if (document.layers)
  104.       {
  105.           eval("i = document." + CSSObject + ".document.CSSForm.menuChoices.selectedIndex");
  106.       }
  107.       else if (document.all)
  108.       {
  109.           range = "all";
  110.       styleObj = ".CSSForm.";
  111.           eval("i = document.all.CSSForm.menuChoices.selectedIndex");
  112.       }
  113.     else if (document.getElementById)
  114.     {
  115.       range = "getElementById('myAddrForm')";
  116.       styleObj = ".";
  117.       i = document.getElementById("myAddrForm").menuChoices.selectedIndex;
  118.     }
  119.  
  120.     if (i == -1)
  121.         return;
  122.  
  123.     eval("address = document." + range + styleObj + "menuChoices.options[i].text");
  124.  
  125.     if (address == "--No Addresses--" || address == CSSselect || address.length == 0)
  126.       {
  127.       return;
  128.     }
  129.       if (address == "" || (address.charAt(0)!='<' && address.charAt(0)!='"'))
  130.     {
  131.       return;
  132.     }
  133.     if (address.charAt(0) == '<')
  134.     {
  135.       i = address.length;
  136.         email = address.substring(j+1, i-1);
  137.       location="<!--IMAIL.UserKey-->/newmsg.cgi?mbx=<!--IMAIL.CurrentMailbox-->&to="+ email;
  138.       return;
  139.     }
  140.     while (address.charAt(j) != '<')  
  141.     {
  142.       j = j+1;
  143.       if (j > address.length )
  144.         break;
  145.     }
  146.     if (j > address.length)
  147.     {
  148.       j = 1;
  149.       i = address.length;
  150.         
  151.       while (address.charAt(j) != '"')
  152.         j = j + 1;
  153.       name = address.substring(1,j);
  154.       if (address.charAt(i - 1) == '>')
  155.         email = address.substring(j+2, i-1);
  156.       else
  157.         email = address.substring(j+2, i);
  158.     }
  159.       else
  160.     {
  161.       name = address.substring(1, j-2);
  162.       i = address.length;
  163.       email = address.substring(j+1, i-1);
  164.     }
  165.       
  166.       location="<!--IMAIL.UserKey-->/newmsg.cgi?mbx=<!--IMAIL.CurrentMailbox-->&to="+ email;
  167.     return;
  168.   } 
  169.  
  170.   // -->
  171.  
  172.  
  173.